<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
    <%@taglib uri="http://www.springframework.org/security/tags" prefix="sec" %>
    <%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>用户管理</title>
  <link href="<c:url value='/resources/bootstrap/bootstrap/css/bootstrap.min.css'/>" rel="stylesheet" media="screen">
    <link href="<c:url value='/resources/bootstrap/bootstrap/css/bootstrap-responsive.min.css'/>" rel="stylesheet" media="screen">
    <script type="text/javascript">
      var basePath = "<c:url value='/'/>";
      
    </script>
</head>
<body>
   


  <body style="padding: 0px;" class="bootstrap-admin-with-small-navbar">
      <div class="container-fluid">
     		<div class="row-fluid">
                        <!-- block -->
                        <div class="block">
                            <div class="block-content collapse in">
                                <div class="span12">
                                   <div class="table-toolbar">
                                     <input class="input-xlarge focused" id="_userName" type="text" placeholder="请输入用户名进行搜索...">
                                      <div class="btn-group">
                                         <a href="#"><button id="_search" class="btn btn-info">搜&nbsp;&nbsp;&nbsp;索 <i class=" icon-search icon-white"></i></button></a>
                                      </div>
                                      <div class="btn-group pull-right">
                                         <button data-toggle="dropdown" class="btn dropdown-toggle">工具 <span class="caret"></span></button>
                                         <ul class="dropdown-menu">
                                            <li><a href="#">打印</a></li>
                                            <li><a href="#">导出pdf</a></li>
                                            <li><a href="#">导出Excel</a></li>
                                         </ul>
                                      </div>
                                   </div>
                                    
                                    <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="_userList">
                                        <thead>
                                            <tr>
                                                <th>编号</th>
                                                <th>用户名</th>
                                                <th>昵称</th>
                                                <th>年龄</th>
                                                <th>性别</th>
                                                <th>邮箱</th>
                                                <th>手机</th>
                                                <th>状态</th>
                                                <th>创建时间</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                       <tbody>
                                       <c:forEach items="${page.result}" var="user" varStatus="indx">
                                       
											<tr>
												<td>${indx.index +1 }</td>
												<td>${user.userName }</td>
												<td>${user.nickName }</td>
												<td>${user.age }</td>
												<td>
												 <c:choose>
												 	<c:when test="${user.sex  eq 0}">男</c:when>
												  <c:otherwise> 女 </c:otherwise>
												 </c:choose>
												</td>
												<td>${user.email }</td>
												<td>${user.mobile }</td>
												<td>
												<c:choose>
												  <c:when test="${user.state  eq 0 }">正常</c:when>
												  <c:otherwise>
												    	  冻结
												  </c:otherwise>
												 </c:choose>
												</td>
												<td> <fmt:formatDate value="${user.createTime }" pattern="yyyy-MM-dd hh:mm:ss"/> </td>
												<td>
												<sec:authorize url="/admin/user/updateUser">
													<button onclick="AdminIndexUser.ctrl.setRole(${user.id})" class="btn  btn-inverse btn-mini"><i class="icon-pencil icon-white"></i> 修改</button>
												</sec:authorize> 
												<sec:authorize url="/admin/user/authorizeUser">
												 <button class="btn  btn-info btn-mini" href="/admin/role/authorizUser.mvc?id=${user.id}"><i class="icon-tags icon-white"></i>设置</button>
												 </sec:authorize> 
												</td>
											</tr>
											</c:forEach>
								        </tbody>
                                    </table>
                                    
                                </div>
                            </div>
                        </div>
                        <!-- /block -->
                    </div>
                    <div class="row-fluid">
                  <div class="span3" >
                  
                  <span style="margin-top: 15px;">共有${page.pageCount }页,${page.totalRecords }条记录</span></div>
                  <div class="span9">  <ul class="pager">
                  				<c:if test="${page.pageNo > 1 }">
									    <li><a href="<c:url value='/admin/user/index.mvc?pageNumber=1&pageSize=20'/>">首页</a></li>
									    </c:if>
									    <c:if test="${ page.pageNo  > 1 }">
									    <li><a href="<c:url value='/admin/user/index.mvc?pageNum=${page.pageNo - 1}&pageSize=20'/>">上一页</a></li>
									    </c:if>
									   
									    <li><a href="<c:url value='/admin/user/index.mvc?pageNum=${page.pageNo + 1}&pageSize=20'/>">下一页</a></li>
									    <c:if test="${page.pageNo < page.pageCount}">
									    <li><a href="#">尾页</a></li>
									    </c:if>
									  </ul></div>
                    </div>
                    <div>
                    </div>
      </div>
      
      
      
      
      
      
      <!-- 按钮触发模态框 -->
<button class="btn btn-primary btn-lg" data-toggle="modal" 
   data-target="#myModal">
   开始演示模态框
</button>

<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden=true>
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" 
               data-dismiss="modal" aria-hidden="true">
                  &times;
            </button>
            <h4 class="modal-title" id="myModalLabel">
               	设置用户角色
            </h4>
         </div>
         <div class="modal-body">
           我是用户角色
         </div>
         <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal">取消
            </button>
            <button type="button" class="btn btn-primary">
               设置
            </button>
         </div>
      </div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
      
      
       <script src="<c:url value='/resources/bootstrap/vendors/jquery-1.9.1.min.js'/>"></script>
    <script src="<c:url value='/resources/bootstrap/bootstrap/js/bootstrap.js'/>"></script>
    <script src="<c:url value='/resources/bootstrap/vendors/jquery-validation/dist/jquery.validate.min.js'/>"></script>
    <script src="<c:url value='/resources/js/admin/user/index.js'/>"></script>
      <%@include file="/jsps/common/autoHeight.jsp" %>
</body>
</html>